import request from '@/utils/request'

/** *
 * 获取组织架构数据
 * **/
export function reqGetDepartments() {
  return request({
    url: '/company/department'
  })
}

/**
 * 根据ID修改部门详情
 */
export function reqDelDepartments(id) {
  return request({
    method: 'delete',
    url: `/company/department/${id}`
  })
}
/**
 * 新增部门
 */
export function reqAddDepartments(data) {
  return request({
    method: 'post',
    url: '/company/department',
    data
  })
}

/**
 * 根据ID查询部门详情
 * 注意有一个ID
 */
export function reqGetDepartDetail(id) {
  return request({
    method: 'get',
    url: `/company/department/${id}`
  })
}

/**
 * 根据ID修改部门详情
 */
export function reqUpdateDepartments(data) {
  return request({
    method: 'put',
    url: `/company/department/${data.id}`,
    data
  })
}
